import unittest
# 两个数字求和
def add(a, b):
    return a + b

class TestAdd(unittest.TestCase):
    def test_add01(self):
        # 调用函数add，传递1，2；预期的结果是3
        result = add(1, 2)
        # 断言，判断结果是否等于预期结果
        assert result == 3
    def test_add02(self):
        result = add(3, 4)
        # assert result == 7
        # 断言两个值是否相等
        self.assertEqual(result, 7)
    def test_add03(self):
        result = add(5, 6)
        ok = result == 11
        # 断言是否为True
        self.assertTrue(ok)
    def test_add04(self):
        # ok = True
        # 断言结果是否为False
        # self.assertFalse(ok)
        # 断言结果是否为None
        result = None
        # self.assertIsNone(result)
        # 断言结果是否不为None
        # self.assertIsNotNone(result)
        # 断言结果中是否包含指定的字符串
        self.assertIn('登录成功', '登录成功，欢迎xxx')
if __name__ == '__main__':
    unittest.main()